< previous page page_972 next page >

Page 972
    Set dbFile = DBEngine.OpenDatabase(dbName)
    Set rsFile = dbFile.OpenRecordset(cSQL, dbOpenSnapshot)

    ShowGraph gphLine, rsFile, cField, cTitle,
    _cFldLegend:=cLegend, cFldLabel:=cLabel,
    _cLeftTitle:="Passengers", cBottomTitle:="Month"

End Sub

Private Sub cmdBar_Click()
    Dim rsFile As Recordset
    Dim dbFile As DATABASE
    Dim cSQL As String
    Dim cField As String
    Dim cTitle As String
    Dim cLegend As String
    Dim cLabel As String
    Dim dbName As String

    cSQL = "Select * from Activity WHERE Airline='ABC';"
    cField = "Passengers"
    cLegend = ""
    cLabel = "Month"
    cTitle = "ABC Airlines Annual Activity"
    dbName = "c:\abc\ch12\12abcex.mdb"

    Set dbFile = DBEngine.OpenDatabase(dbName)
    Set rsFile = dbFile.OpenRecordset(cSQL, dbOpenSnapshot)

    ShowGraph gphBar3D, rsFile, cField, cTitle,
    _cFldLegend:=cLegend, cFldLabel:=cLabel,
    _cLeftTitle:="Passengers", cBottomTitle:="Month"

End Sub
Day 12
Answers to Day 12 Quiz
1. Using a data-bound list or combo box increases the speed of data entry, gives you added control over data validation, and provides suggested values to use for entry.
2. You set the RowSource property to identify the data source for the list box.
3. The BoundColumn property sets the column that is saved in the new data record. Put another way, it's the field that is extracted from the source and placed in the destination. Remember that the bound column does not have to equal the ListField property of the control.
4. You set the DataSource property to the name of the dataset that should be updated by the contents of the data-bound list/combo box. You set the DataField property

 
< previous page page_972 next page >

If you like this book, buy it!